#include "Delete.h"
#include "IVisitor.h"

Delete::Delete(const ExprTypeList& target, int nodeId):
    stmtType(nodeId),
    _target(target)
{
}
    
Delete::~Delete()
{
    _target.clear();
}
    
QString Delete::type() const
{
    return "Delete";
}
    

ExprTypeList Delete::target()
{
    return _target;
}

void Delete::setTarget(const ExprTypeList& target)
{
    _target = target;
}

    
QString Delete::toString() const
{
    return QString("Delete[target=%1]").
                arg(_target.toString());
}
    
void Delete::accept(IVisitor* visitor, const SimpleNodePtr& node)
{
    visitor->visitDelete(node.dynamicCast<Delete>());
}
    
void Delete::traverse(IVisitor* visitor)
{
    _target.traverse(visitor);
}